home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / qb4text.arc / QB4
Encoding:
Text File  |  1987-10-18  |  19.6 KB  |  372 lines

  1. Subject: Microsoft QuickBASIC 4.0 Introduces "Instant" Programming
  2. Date: Fri Oct 16 14:22:54 1987
  3.  
  4.    REDMOND, WA -- OCTOBER 23, 1987 -- Microsoft Corporation today announced
  5. Microsoft(R) QuickBASIC Version 4.0, a combined compiler-debugger-interpreter
  6. that is so fast, the company is calling it an "Instant Environment." Microsoft
  7. QuickBASIC 4.0 boasts speeds of up to 150,000 lines per minute, program
  8. modification and debugging without recompilation, an editor that checks syntax
  9. as you type, and instantaneous command testing.
  10.    Based on revolutionary language technology, QuickBASIC 4.0 is actually a
  11. "threaded p-code interpreter" which offers the speed of a compiler and the
  12. interactiveness of an interpreter. This technology incorporates users' changes
  13. to their programs at an incredible 150,000 lines per minute (Speed
  14. measurements based on an 8 MHz PC-AT).
  15.    Microsoft QuickBASIC 4.0 comes fully integrated with a subset of
  16. Microsoft's CodeView(TM) debugger, offers multiple module programming support,
  17. many powerful enhancements to the BASIC language, and a multi-file/window
  18. editor that supports WordStar(R) commands.
  19.    Microsoft's product manager for languages, Rob Dickerson said, "Microsoft
  20. QuickBASIC 4.0 is more than a new language. It's a new language processing
  21. system that combines the speed of a compiler with the interactiveness of an
  22. interpreter. Most operations happen so fast they appear to be instantaneous.
  23. Because the functionality of Microsoft QuickBASIC 4.0 has never been available
  24. before in a PC-based BASIC, we've coined a new phrase for it: Instant
  25. Environment. It represents nothing short of a revolution in programming."
  26.  
  27. Instant Results
  28.    The most important feature of Microsoft QuickBASIC 4.0 is its speed: the
  29. speed of a compiler, the interactiveness of an interpreter. If a program is
  30. interrupted and changed, Microsoft QuickBASIC 4.0 incorporates changes at
  31. 150,000 lines per minute (Speed measurements based on an 8 MHz PC-AT). There
  32. is no perceptible delay from the point of view of the user, who simply
  33. stops the program, makes changes, and continues execution without delay.
  34.    Additional Microsoft QuickBASIC 4.0 "instant" features include:
  35.  
  36.    1. Edit and Continue. Interrupt your running program, make changes to it,
  37. and in most cases you can continue running instantly from where you left off,
  38. with all of your data values intact.
  39.    2. Total memory availability. All machine memory is available
  40. for programming.
  41.    3. Instant syntax checking. As soon as a line of code is entered, it is
  42. checked for correct syntax.
  43.    4. Instant command testing. A single line of BASIC code can be tested
  44. instantly through an immediate window.
  45.  
  46. Instant Debugging
  47.    Microsoft QuickBASIC 4.0 comes fully integrated with a subset
  48. of Microsoft's CodeView debugger, which provides powerful source
  49. code debugging. One function key initiates debugging, with no delay, at
  50. any time during program development.
  51.    Breakpoints can be set and cleared at any statement, "watch" points can be
  52. used to conditionally break when expressions become true, and "watch"
  53. expressions display the value of variables while the program is running.
  54. Expressions can be as simple as a single variable or can refer to procedures
  55. written in BASIC or other Microsoft languages, allowing programs to break on
  56. complex state changes.
  57.  
  58.    In addition to breakpoints and "watch" expressions, Microsoft QuickBASIC
  59. 4.0 provides a number of other mechanisms for facilitating program control
  60. during debugging:
  61.  
  62.    Animated trace
  63.    Single stepping forward with history
  64.    Procedure stepping
  65.    Stack tracing
  66.    Procedure and COMMON block type checking
  67.  
  68. Mixed Language Programming
  69.    As a member of Microsoft's family of inter-callable languages, Microsoft
  70. QuickBASIC 4.0 allows the user to invoke code written in any other Microsoft
  71. language such as Microsoft C 5.0, QuickC(TM), MASM 5.0, Pascal 3.32, or
  72. Fortran 4.01. Mixed-language programs can be debugged at the source code level
  73. using CodeView.
  74.  
  75. Instant Help
  76.    Microsoft QuickBASIC 4.0 provides context-sensitive help for all keywords
  77. in the language, and for all operations in the instant environment. The user
  78. simply places the cursor near the keyword and with the touch of a function key
  79. sees the syntax of the statement.
  80.  
  81. Instant EXE and Library Creation
  82.    Microsoft QuickBASIC 4.0 expedites EXE and library creation
  83. with menu-selectable options. The selection "Make EXE" causes an EXE to
  84. be generated automatically. EXEs can run stand-alone or rely on a
  85. run-time file.
  86.    Similarly for libraries, the selection "Make Library" creates both a
  87. QuickLibrary (the QB4 version of the QB3 library) and a regular library in a
  88. single operation. The Microsoft QuickBASIC 4.0 linker allows the user to
  89. create libraries written in other Microsoft languages.
  90.  
  91. Multiple Module Programming Is Now Pain-Free
  92.    Microsoft QuickBASIC 4.0 adds structure to BASIC programming
  93. by accommodating multiple modules in memory at the same time. The QuickBASIC
  94. windowing environment allows the user to view and edit one or two of the
  95. modules simultaneously in separate windows. In addition, the user can browse
  96. an indented list of modules and procedures with the Program Outliner. The
  97. Program Outliner also allows SUBs and FUNCTIONs to be deleted or moved from
  98. one module to another. Between development sessions, QuickBASIC 4.0
  99. automatically saves and loads all related modules.
  100.    SUB and FUNCTION references support full type checking between modules,
  101. preventing program breakage at run-time due to incorrect argument passing.
  102.  
  103. Powerful BASIC Enhancements
  104.    Microsoft QuickBASIC 4.0 includes a powerful set of enhancements to the
  105. BASIC language that make it more appealing to both business users and
  106. professional programmers. Some of the key enhancements are:
  107.  
  108.    1. Record support. Microsoft QuickBASIC 4.0 now supports user-defined
  109. types or "records" that simplify random file I/O and make programs easy to
  110. understand.
  111.    2. Recursion. Microsoft QuickBASIC 4.0 is the first version of Microsoft
  112. BASIC to support recursive SUBs and FUNCTIONs.
  113.    3. FUNCTIONs. Microsoft QuickBASIC 4.0 is the first Microsoft BASIC to
  114. support true functions.
  115.    4. Arrays. Microsoft QuickBASIC 4.0 now supports arrays larger than 64K as
  116. a command line option.
  117.    5. Array index ranges. The Microsoft QuickBASIC 4.0 index range is -32768
  118. to 32767, with the ability to declare lower bounds for arrays other than 0 or
  119. 1.
  120.    6. Long integers. A four-byte integer data type has been added.
  121.    7. Multi-language interface. A new DECLARE statement allows Microsoft
  122. QuickBASIC 4.0 to call programs written in other Microsoft languages as well
  123. as providing type checking for BASIC procedure calls.
  124.  
  125. Binary File I/O
  126.    To make it easier to interface to business application software such as
  127. dBASE III(R) or Lotus(R) 1-2-3(R), Microsoft has added binary file I/O
  128. capability to Microsoft QuickBASIC 4.0. Specifically, three statements have
  129. been enhanced -- OPEN, GET and PUT -- to allow access to a file at the byte
  130. level. A new statement, SEEK, has been added to provide direct access to any
  131. part of a file. Binary file I/O allows reading and writing any BASIC variable
  132. (including records) to any byte position in a file.
  133.  
  134. Hercules Graphics
  135.    QuickBASIC 4.0 now supports the Hercules(TM) graphics adapters. This
  136. includes support for the Hercules Graphics Card, the Graphics Card Plus, as
  137. well as the InColor Card.
  138.    Implemented with an enhanced SCREEN statement, this support gives 720 X 348
  139. pixel resolution graphics with two screen pages on systems with a Hercules
  140. card installed.
  141.  
  142. Microsoft QuickBASIC 4.0 Pricing, Availability
  143.    The new Microsoft QuickBASIC 4.0 compiler is available now at all Microsoft
  144. retail outlets. It has a suggested retail price of $99, which Microsoft is
  145. complementing with a 30-day no-risk, money-back guarantee. Upgrade pricing is
  146. $25 for 3.0 owners and $35 for owners of versions prior to 3.0.
  147.    Minimum system requirements for Microsoft QuickBASIC 4.0 are an IBM(R)
  148. Personal Computer or compatible with 320K of memory, MS-DOS 2.1 or higher, and
  149. one double-sided disk drive. Microsoft recommends two disk drives.
  150.  
  151.    For more information about either the product or the demo disk, contact
  152. Microsoft's Customer Service Department at 206/882-8080 (in Washington state),
  153. or write to Microsoft's Customer Service Department at Box 97017, Redmond,
  154. Washington 98073-9717.
  155.  
  156.    Microsoft Corporation (NASDAQ "MSFT") develops, markets and supports a wide
  157. range of software for business and professional use, including operating
  158. systems, languages and application programs as well as books and hardware for
  159. the microcomputer marketplace.
  160.  
  161.    Microsoft and the Microsoft logo are registered trademarks and QuickC and
  162. CodeView are trademarks of Microsoft Corporation.
  163.    IBM is a registered trademark of International Business
  164. Machines Corporation.
  165.    dBASE III is a registered trademark of Ashton-Tate Corporation.
  166.    Lotus and 1-2-3 are registered trademarks of Lotus
  167. Development Corporation.
  168.    WordStar is a registered trademark of MicroPro International.
  169.    Hercules is a trademark of Hercules Computer Technology.
  170.  
  171. Type Declarations and Record Structures
  172.  
  173.    QuickBASIC Version 4.0 adds support for User Definable Types and Record
  174. Structures. An example might look like:
  175.  
  176.      TYPE PersonName
  177.           Last AS STRING * 15
  178.           First     AS STRING * 15
  179.           MiddleInit     AS String * 1
  180.           SocSecNum AS LONG
  181.      END TYPE
  182.  
  183.      Record Variable Declarations
  184.  
  185.    Using the type we defined in the above example, an example declaration might
  186. look like:
  187.  
  188.      DIM PersonTable(50) as PersonName
  189.  
  190.      Random I/O
  191.  
  192.    The FIELD statement is no longer required for RANDOM I/O -- you can PUT and
  193. GET a record to a RANDOM file. For example:
  194.  
  195.      PUT #1,10,PersonTable(10)
  196.  
  197. Recursion
  198.    QuickBASIC 4.0 now supports recursive SUBs and FUNCTIONs.
  199.  
  200. FUNCTIONs
  201.    QuickBASIC V4.0 now supports FUNCTIONs. FUNCTIONs differ from DEF FNs in
  202. that FUNCTIONs may have local static and dynamic variables and are public to
  203. other modules. They can also be recursive. FUNCTIONs are similar to SUBs
  204. except that they return a value.
  205.  
  206. Binary File I/O
  207.    QuickBASIC 4.0 now supports a new file access mode known as Binary File
  208. I/O. This is implemented via enhancements to the OPEN, GET, and PUT
  209. statements. Binary File I/O allows the program to operate on files on a byte
  210. level.
  211.  
  212. Keywords for Mixed-Language Calling
  213.    QuickBASIC 4.0 now has special keywords CDECL and BYVAL to support mixed
  214. language programming with other Microsoft languages, including Macro Assembler
  215. 5.0, Quick C 1.0, C Compiler 5.0, and FORTRAN 4.0.
  216.  
  217. Miscellaneous Language Enhancements
  218.    Long Integers: QuickBASIC 4.0 now supports a 4-byte Integer data type.
  219.    Array Index Ranges: QuickBASIC 4.0 now supports lower bounds for arrays to
  220. be in the range -32768 to 32767.
  221.    UCASE$ & LCASE$: Translates the given string to upper and lower case
  222. respectively.
  223.  
  224.    QuickBASIC 4.0 is the latest in Microsoft's line of user-friendly
  225. compilers. Or is it? In QB4 you can always run your code without waiting for
  226. compilation. You can always debug. You can test out statements just by typing
  227. them in. You can even interrupt your program while it's running, change a line
  228. (or three) and pick up where you left off--with your data intact. Sounds too
  229. user friendly to be a compiler!
  230.  
  231. Is It an Interpreter?
  232.    QB4 executes your programs in memory much faster than BASICA ever did. In
  233. fact, your programs will run almost as fast inside QB4 as they will when you
  234. make them into separate EXEs. Now how could an interpreter do that?
  235.  
  236. We Compile in Order to Interpret: Threaded P-Code
  237.    The answer to this riddle is that we compile your programs to a form that's
  238. about 90 percent along the way to real native machine code--it's called
  239. threaded p-code. Since threaded p-code looks almost like the output of a
  240. compiler, it runs almost as fast as you would expect an EXE to run. But it
  241. retains enough information--the crucial last bits that machine code loses--to
  242. allow us to list it to the screen in source code format, and to modify it if
  243. you decide to make changes. For the first time you can run, debug, and edit
  244. your program as much as you want with virtually no speed penalty!
  245.    Since threaded p-code isn't quite ready for the CPU to execute, we have to
  246. provide an interpreter to execute it. We aren't willing to give up much
  247. execution speed, however, so we've done our best to make the interpreter small
  248. and fast. We'll give away a secret and show you the threaded p-code
  249. interpreter:
  250.  
  251.    LODSW ES
  252.    JMP   AX
  253.  
  254.    This isn't a mistake. Our threaded p-code interpreter consists wholly of two
  255. assembly code instructions, occupying a total of 4 bytes and taking 7 CPU
  256. cycles to execute. That's all of it.
  257.  
  258. The Threaded P-Code Interpreter
  259.    OK, that's not quite the whole story. Threaded p-code interpretation works
  260. like this: each BASIC statement is translated from source code form into
  261. threaded p-code, which is made up of a series of executor addresses. Executor
  262. addresses are simply the addresses in memory of the routines or executors that
  263. perform the tasks necessary to execute a BASIC statement, such as "PRINT" (to
  264. print a value to the screen) or "+" (to add two integers).
  265.    The LODSW instruction in the interpreter simply loads AX with the next
  266. executor address from threaded p-code, and JMP AX transfers control to the
  267. executor that performs the task. Instead of returning from the executor with a
  268. wasteful RET instruction (remember that we JMP'd, not CALL'd to it), the same
  269. two interpreter instructions LODSW and JMP are tacked onto the end of each
  270. executor, so we "thread" our way from task to task with virtually no
  271. performance overhead.
  272.  
  273. "Instant" Program Changes: a Three-State Machine
  274.    There's one difficulty with the threaded p-code scenario: while threaded
  275. p-code retains enough information to allow the re-creation of your source code
  276. from the executor addresses and their data, this process takes time. And
  277. recompiling back to threaded p-code after you edit your program takes more
  278. time.
  279.    We wanted QB4 to really be "instant," however, so we took a hard look at
  280. which of the translation tasks were time-consuming and which were quick, and
  281. realized that we could save you time by creating an intermediate program
  282. format (which we call a "state") between editable code and threaded p-code.
  283. This left us with three states, which we call PARSED, symbolic, and threaded.
  284.  
  285. PARSED
  286.    When you load a program into QB4 from disk, or type in a new program, QB4
  287. immediately translates your BASIC statements into a format called PARSED. As
  288. the name implies, most syntax checking is done at this time. Any time you make
  289. a large-scale change to your program, such as adding several new COMMON data
  290. declarations, QB4 automatically translates your program back to the PARSED
  291. state.
  292.  
  293. SYMBOLIC
  294.    When you run a newly-loaded or typed program for the first time, QB4
  295. prepares to interpret it by translating it from the PARSED to the SYMBOLIC
  296. state. The lion's share of this work is the creation of a symbol table that
  297. allows QB4 to easily access the data in your program.
  298.  
  299. THREADED
  300.    QB4's final step toward preparing your program for running is to translate
  301. the actual operations that your program performs into executor addresses. QB4
  302. does this immediately after it has completed the change from PARSED to
  303. SYMBOLIC.
  304.  
  305. An In-Depth Look at QB4's State Changes
  306.    Exactly how do these state changes occur while you're developing a program?
  307. As we mentioned above, when you run your program for the first time, we
  308. translate it from the editable PARSED to the intermediate SYMBOLIC state. The
  309. major task that we perform in changing from PARSED to SYMBOLIC is to generate
  310. a symbol table for all of your data so we can easily locate data items during
  311. program execution. In fact, this symbol table is virtually identical to the
  312. efficient symbol tables that compilers generate for fast data access.
  313.  
  314.    Immediately following the PARSED to SYMBOLIC change is the move from
  315. SYMBOLIC to THREADED. This entails inserting type - checking code, binding
  316. procedure calls, control structures and labels to actual memory locations,
  317. linking COMMON data, and of course generating the executor addresses that
  318. characterize threaded p-code. By now your program is running, and since the
  319. complete PARSED-SYMBOLIC-THREADED state change proceeds at about 60,000 (60K)
  320. lines/minute (on an IBM PC AT at 8 megahertz), you won't have waited as long
  321. for this "compile" as you would in QuickBASIC 3.0--and you'll have waited
  322. 1/10th the time that our competitors take.
  323.    Of course, if you change your program while it is running, we have to back
  324. up or "de-scan" a part of it--as small a part as a single SUB or FUNCTION most
  325. of the time. Since the de-scan from THREADED to SYMBOLIC is lightning fast and
  326. doesn't disrupt your program's data (allowing you to "edit and continue") we
  327. try to limit all de-scan changes from THREADED to SYMBOLIC rather than all the
  328. way back to PARSED. And for most changes we can do this. In fact, there are
  329. only a few types of edits you can make to your program that will take you back
  330. to PARSED--notably, changes to COMMON, SHARED or DEF type (such as DEFINT)
  331. statements. Most other edits allow you to continue running after the
  332. ultra-fast state change from THREADED to SYMBOLIC and back. It's the 150,000
  333. (150K) line/minute rate of this change that lets us call QB4 "instant."
  334.  
  335.    Think about the implications of this for a moment. For the first time ever,
  336. you are always ready to run or debug your programs. You might wonder, "Hasn't
  337. QB4 just moved the task of compilation to occur before I edit my program,
  338. rather than after?" Although that's true, how many times do you recompile a
  339. program before you've got it working just the way you want it to? When you add
  340. all of those compile delays up, you start to see how QB4 really lets you
  341. cruise. Add in the time that you used to spend getting back to the point in
  342. your program where you discovered a bug (instead of simply fixing the bug and
  343. continuing execution), and you're light years ahead with QB4.
  344.  
  345. Single Representation Means Bigger Programs
  346.    It's important to realize that, unlike previous QuickBASICs or our
  347. competitors, we always maintain your program in only one state at a time in
  348. memory. That means you never use double the memory that your program
  349. needs--once for the program's source code and once for it's compiled
  350. instructions--so we avoid the painful situation of being able to edit a
  351. program but not being able to compile it.
  352.  
  353. QuickLibraries and Interlanguage Calling
  354.    There is a caveat to this view of the QB4 world: QuickLibraries (QB4's
  355. easy-to-use replacement for UserLibraries in QB3) are made up of actual
  356. machine code, which is why you can't list them even if you've loaded them in
  357. QB4. There are two huge advantages of using QuickLibraries. First,
  358. QuickLibraries are the very fastest executing code objects in QB4 memory, so
  359. they are perfect for well-tested subs and functions. Second, QuickLibraries
  360. can hold code written in any Microsoft language, so they are the gateway to
  361. easy interlanguage calling from QuickBASIC to C, MASM, FORTRAN, or Pascal.
  362. Just tell the linker to generate a QuickLibrary and you're ready to go.
  363.  
  364. QB4: The Instant Environment
  365.    It's not a compiler and it's not an interpreter. Threaded p-code makes QB4
  366. an instant environment. You're always ready to run, you're always ready to
  367. debug, you can test statements on the fly, and you're never drumming your
  368. fingers waiting for a long compile after you make that last teensy change to
  369. your program. Benefits like these are a step into the future.
  370.  
  371.  
  372.